﻿using System;
using System.ComponentModel.DataAnnotations;

namespace Domain.Entities
{
    public partial class User
    {
        public int Id { get; set; }
        [Required]
        [Display(Name = "Имя пользователя")]
        public string Login { get; set; }
        [Required]
        [DataType(DataType.Password)]
        [Display(Name = "Пароль")]
        public string Password { get; set; }
        [Required(ErrorMessage = "Введите E-mail")]
        [Display(Name = "E-mail")]
        [RegularExpression(@"^([a-z0-9_-]+\.)*[a-z0-9_-]+@[a-z0-9_-]+(\.[a-z0-9_-]+)*\.[a-z]{2,6}$", ErrorMessage = "Не верный формат Email")]
        public string Email { get; set; }
        [Required(ErrorMessage = "Введите имя")]
        public string FirstName { get; set; }
        [Required(ErrorMessage = "Введите фамилию")]
        public string LastName { get; set; }
        public int RoleId { get; set; }
        [Required(ErrorMessage = "Введите отчество")]
        public string MiddleName { get; set; }
        public DateTime CreateDate { get; set; }
    
        public string Address { get; set; }
        public string City { get; set; }
        public string State { get; set; }
        public string PostalCode { get; set; }
        public string Phone { get; set; }

        public virtual Role Role { get; set; }
    }
}
